<%@ page import="com.devicemantra.coordinate.dataobjects.*,java.util.*,com.google.appengine.api.datastore.KeyFactory" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" type="text/css" href="/css/tab.css" />
<script type="text/javascript">

function js_handle_event()
{
	var x=document.getElementById("select_box");
	document.getElementById('message').innerHTML = "";
	//alert(x.selectedIndex);
	//alert("SELECT CLICKED");
}
</script>

</head>
<body>
<ul id="tabmenu">
	<li><a href="/AdminController?id=country">Country</a></li>

	<li><a  href="/AdminController?id=states">States</a></li>
	<li><a  href="/AdminController?id=department">Department</a></li>
	<li><a class="active" href="/AdminController?id=users">Users</a></li>
</ul>
<br><br><br><br>
<B>Department / User &nbsp;&nbsp;&nbsp;&nbsp; </B>
<form name="password_change_form" method="post" action="/AddLoginInfo" >
<select name="select_box" onchange="js_handle_event()">
<option value="">Please Select a User </option>
<optgroup label="Super Users">
<option value="SUPER_ADMIN">SUPER_ADMIN</option>
</optgroup>
<optgroup label="Department Users">
<%
	String lUser = (String)request.getAttribute("USER");
	List<CDepartment> lDeptList = CDepartmentFactory.getAllDepartments();
	for( int lCounter = 0; lCounter < lDeptList.size(); lCounter++)
	{
		CDepartment lDept = lDeptList.get(lCounter);
		if(lDept.getDepartmentName().equals(lUser))
		{
			out.print("<option value=\"" + lDept.getDepartmentName() +  "\"" +  " selected " +  " >" + lDept.getDepartmentName() +    "</option>");
			continue;
		}
		out.print("<option value=\"" + lDept.getDepartmentName() +  "\"" +  " >" + lDept.getDepartmentName() + "</option>");
	}
%>
</optgroup>
</select><br><br>
<br>
<table>
<tr><td>Username :&nbsp;&nbsp;&nbsp;&nbsp;<input type=text name="user_name" value="admin" readonly ></td></tr>
<tr><td align=center>Password : &nbsp;&nbsp;&nbsp;&nbsp;<input type="password" name="password" value="" ><BR><BR></td></tr>
<tr><td><div id="message">
<% 
	String lMessage = (String)request.getAttribute("message"); 
	if( lMessage != null )
	{
		out.print("<font color=green>" + lMessage + "</font><br>");
	}

%></div></td></tr>
<tr><td><input type="submit" value="Reset Password"></input>
</table>
</form>
</body>
</html>
